package com.tcredit.spider;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;

@SpringBootApplication//@SpringBootApplication 是Spring Boot项目的核心注解，主要目的是开启自动配置
@MapperScan(basePackages = "com.tcredit.spider.web.dao")// mybatis事物控制2/3 (dao包指向)
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Bean
    public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
        return args -> {

        	/*
            System.out.println("让我们来看看springboot的启动，加载了多少bean:");

            String[] beanNames = ctx.getBeanDefinitionNames();
            Arrays.sort(beanNames);
            for (String beanName : beanNames) {
                System.out.println(beanName);
            }
        	 */
        };
    }

}
